import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;

import java.util.Arrays;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User:恋恋
 * Date:2022-09-19
 * Time:15:55
 */
public class TestDemo {

    public static int add(int a, int b) {
        //   fun();
        System.out.println("这是整型的add");

        return a + b;
    }

    public static double add(double a, double b) {
        System.out.println("这是double的add");
        return a + b;
    }

    public void fun() {
        System.out.println("hello");
    }

    public static void print(int[] arr) {
        arr[0] = 10;
    }

    public static int fun(int num) {
        if (num == 1) {
            return 1;
        }
        return num + fun(num - 1);
    }

    public static void main(String[] args) {
        int[] str = new int[3];//动态
        int[] str1 = new int[]{3, 4, 5, 6, 7};
        double sum = add(3.5, 4.4);
        System.out.println();
        int[] arr = new int[]{1, 2, 34, 5, 6, 8};
        System.out.println("传参之前arr：" + Arrays.toString(arr));
        print(arr);
        System.out.println("传参之后arr：" + Arrays.toString(arr));
        int sum2 = fun(5);
        System.out.println(sum2);
    }
}

